<%@ page language="java"  pageEncoding="utf-8"%>
<%@taglib uri="/WEB-INF/struts-tags.tld" prefix="s"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>邮件</title>
<%@include file="../common/jscss.jsp" %>
</head>

<body>
	<!-- head -->
	<%@include file="../common/header.jsp" %>
    <!-- head--end -->
    
    <!-- body -->
    <div class="content">
    	<div class="body_wrap clearfix">
            <div class="com_left">
            	<div class="com_pd_s1">
                	<div class="box_s2">
                    	<div class="title"><img src="images/other/icon_10.jpg" /><span>发件箱</span></div>
                        <div class="form_list">
                        	<ul class="data_head state_box">
                            	<li class="name">收件人</li><li class="info">内容</li><li class="date">日期</li><li class="state">状态</li><li class="data_ope">操作</li>
                            </ul>
                            <ul class="form_data state_box">
                            	<s:iterator id="mail" value="pageModel.list" status="status">
				              		<li>
	                                    <div class="name"><span><s:property value="rusername" /></span></div>
	                                    <p class="info"><a href="mail!readmail.do?messageId=<s:property value="id" />"><s:property value="title"/></a></p>
	                                    <p class="date"><s:date name="modifyDate" format="yyyy.MM.dd"/></p>
	                                    <p class="state">
	                                    <s:if test="sendStatus">
	                                    	<i class="sucess"></i>
	                                    </s:if>
	                                    <s:if test="!sendStatus">
	                                    	<i class="fail"></i>
	                                    </s:if>
	                                    </p>
	                                    <div class="data_ope">
	                                        <a href="mail!edit.do?messageId=<s:property value="id" />">修改</a><a href="javascript:;" onclick="deleteMail('<s:property value="id" />')">删除</a><a href="javascript:;" onclick="resend('<s:property value="id" />')">重发</a>
	                                    </div>
	                                </li>
				              	</s:iterator>
                            
                                
                            </ul>
						</div>
                    </div>
                    
                  <div id="fy_container"></div>
                    
                </div>
            </div>
            
            <!-- right -->
            <%@include file="right.jsp"%>
            <!--right--end-->
            <br class="clear" />
        </div>
    </div>
    <%@include file="../common/footer.jsp" %>
     <script type="text/javascript">
    	$(function(){
	    	$.defUnit.pager({
					curPage:<s:property value="pageModel.currentPage" />,
					totalPage:<s:property value="pageModel.totalPage" />,
					customStyle:"customStyle",
					containerID:"fy_container",
					afterClickPage:function(page){
						window.location.href="mail!sendbox.do?page="+page;
					}		
				}
			)
    		
    	});
    	
    	function resend(id){
    		if(confirm("确定要重发邮件吗？")){
    			$.post("mail!resend.do",{
    				messageId:id
    			},function(data){
    				var ret = $.parseJSON(data);
    				if(ret.success == 'true'){
    					alert(ret.msg);
    				}else{
    					alert(ret.msg);
    				}
    			});
    		}
    	}
    	
    </script>
</body>
</html>
